Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Upgrade spring-boot-starter from version 2.7.x to 3.3.x #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mroyme
Copy link

@mroyme mroyme commented Jul 26, 2024

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew build --write-locks to refresh dependencies)
  • Other (please describe)
    Dependency upgrade: Upgrading spring-boot from version 2.7.+ to 3.3.+

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR


Note: Why Apache bVal and not Hibernate Validator or Spring Boot Validator?

A: Firstly, Spring Boot Validator transitively depends on Hibernate Validator, so using either of them provides the same underlying Bean Validation implementation.

The problem with using Hibernate Validator is that it breaks the existing tests.

What I noticed is that validator.validate(...) would always raise twice the number of violations. One of which is the actual violation and the other with empty values. I tried to find the cause, and came across a few threads with some not so convincing explanations and workarounds, none of which seemed to work. And after spending a good few hours trying to figure the problem, I still couldn't understand why I was seeing that behavior.

In the end, I gave BVal a shot, and it worked fine on the first try. Anyway, BVal supports Bean Validation 3.0, is TCK certified and is being updated frequently. So, I didn't see any reason not to go with it. Also, if we indeed want to use some different implementation in the future; we just have to remove the BVal dependency and add whatever else we want to use.

@mroyme
Copy link
Author

mroyme commented Jul 26, 2024

#8 is the issue.

@mroyme mroyme changed the title Upgrade spring-boot-starter from version 2.7.x to 3.3.x [WIP] Upgrade spring-boot-starter from version 2.7.x to 3.3.x Jul 26, 2024
@mroyme
Copy link
Author

mroyme commented Jul 26, 2024

Okay, I just found out this needs work. This causes problems with the way the project uses Jackson.
Will spend some time to see how I can fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant